/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controleur;

import Model.Jeu;
import Vue.Vue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.SwingUtilities;

/**
 *
 * @author Benjamin
 */
public class Tetris implements ActionListener{

    private Jeu jeu;
    private Vue vue;

    public Tetris() {
        this.jeu = new Jeu();
        this.vue = new Vue(jeu);
        jeu.addObserver(vue);

    }

    public Jeu getJeu() {
        return jeu;
    }

    public Vue getVue() {
        return vue;
    }

    public static void main(String[] args) {
     

        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                
                Tetris tetris = new Tetris();
                tetris.getVue().setVisible(true);
                
                Thread t = new Thread(tetris.getJeu());
                t.start();

            }
        });

    }

    @Override
    public void actionPerformed(ActionEvent e) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
